package com.tengju.bff.interfaces.app.charge;

import com.fasterxml.jackson.core.type.TypeReference;
import com.tengju.bff.domain.shared.JsonUtil;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

public class ChargeConstants {

    private static final String BRAND_STR = "{\"10001\":\"Minenssey\",\"10002\":\"拿破仑·布得斯\",\"10003\":\"MitoQ®\",\"10004\":\"Penfolds\",\"10005\":\"THALISSI\",\"10006\":\"Dr.LeWinn's\",\"10007\":\"melrose\",\"10008\":\"NU-LAX\",\"10009\":\"BEAN BODY\",\"10010\":\"BEE+\",\"10011\":\"Paulett Wines\",\"10012\":\"Robert Oatley\",\"10013\":\"Vida Glow\",\"10014\":\"Savar\",\"10015\":\"BURGE FAMILY\",\"10016\":\"ch22\",\"10017\":\"Alissi Bronte\",\"10018\":\"VANDENBERG\",\"10019\":\"TORRES\",\"10020\":\"Amilera\",\"10021\":\"eimele\",\"10022\":\"Hunter Lab\",\"10023\":\"SENSORI+\",\"10024\":\"INVISIBLE ZINC\",\"10025\":\"Lovekins\",\"10026\":\"Thorne\",\"10027\":\"DOVERIST\",\"10028\":\"BEEOTIC\",\"10029\":\"大摩\",\"10030\":\"SHANGPREE\",\"10031\":\"EBL高定系列\",\"10032\":\"Dr.Arrivo\",\"10033\":\"Lovekins Women\",\"10034\":\"Mila Moursi\",\"10035\":\"贵州习酒\",\"10036\":\"五粮液\",\"10037\":\"泸州老窖\",\"10038\":\"Life Space\",\"10039\":\"雅萌\",\"10040\":\"Ostelin\",\"10041\":\"Aptamil\",\"10042\":\"HOII/后益\",\"10043\":\"JAYJUN\",\"10044\":\"IsoWhey\"}";
    private static final String BRAND_FACTOR_STR = "{\"10001\":\"1\",\"10002\":\"1\",\"10003\":\"1\",\"10004\":\"1\",\"10005\":\"1\",\"10006\":\"1\",\"10007\":\"1\",\"10008\":\"1\",\"10009\":\"1\",\"10010\":\"1\",\"10011\":\"1\",\"10012\":\"1\",\"10013\":\"2\",\"10014\":\"1\",\"10015\":\"1\",\"10016\":\"1\",\"10017\":\"1\",\"10018\":\"1\",\"10019\":\"1\",\"10020\":\"1\",\"10021\":\"1\",\"10022\":\"1\",\"10023\":\"1\",\"10024\":\"1\",\"10025\":\"1\",\"10026\":\"1\",\"10027\":\"1\",\"10028\":\"1\"}";
    private static final String ACTION_STR = "{\"1\":\"团队培训\",\"2\":\"市场调研\",\"3\":\"招商活动\",\"4\":\"宣传物料\",\"5\":\"渠道拓张\",\"6\":\"新媒体合作\",\"7\":\"私享会\",\"8\":\"其他\",\"100\":\"自媒体\",\"200\":\"社群\"}";
    private static final String ACTION_FACTOR_STR = "{\"1\":\"1\",\"2\":\"1\",\"3\":\"2\",\"4\":\"3\",\"5\":\"4\",\"6\":\"3\",\"7\":\"1\",\"8\":\"1\",\"100\":\"2\",\"200\":\"2\"}";

    public static final int ACTION_OTHER_FACTOR = 1;

    public static final long ACTION_SELF_MEDIA_ID = 100;
    public static final long ACTION_COMMUNITY_ID = 200;

    public static final int SELF_MEDIA_FACTOR = 5;
    public static final int COMMUNITY_FACTOR = 5;

    public static final Map<Long, Integer> DEFAULT_BRAND_FACTORS;
    public static final Map<Long, Integer> DEFAULT_ACTION_FACTORS;
    public static final Map<Long, Integer> DEFAULT_ACTION_COUNT;
    public static final Map<Long, String> BRANDS;
    public static final Map<Long, Integer> BRAND_FACTORS;
    public static final Map<Long, String> ACTIONS;
    public static final Map<Long, Integer> ACTION_FACTORS;
    public static final String[] ACTIONS_NAMES = {"社群管理", "自媒体", "私享会", "宣传物料"};


    static {


        Map<Long, Integer> defaultBF = new HashMap<>();
        defaultBF.put(10001L, 1);
        defaultBF.put(10002L, 1);
        defaultBF.put(10003L, 1);
        DEFAULT_BRAND_FACTORS = Collections.unmodifiableMap(defaultBF);

        Map<Long, Integer> defaultAF = new HashMap<>();
        defaultAF.put(1L, 1);
        defaultAF.put(2L, 1);
        defaultAF.put(3L, 1);
        defaultAF.put(100L, 2);
        defaultAF.put(200L, 2);
        DEFAULT_ACTION_FACTORS = Collections.unmodifiableMap(defaultAF);

        Map<Long, Integer> defaultAC = new HashMap<>();
        defaultAC.put(1L, 1);
        defaultAC.put(2L, 1);
        defaultAC.put(3L, 1);
        defaultAC.put(100L, 1);
        defaultAC.put(200L, 1);
        DEFAULT_ACTION_COUNT = Collections.unmodifiableMap(defaultAC);

        BRANDS = Collections.unmodifiableMap(Objects.requireNonNull(JsonUtil.toCustomMap(
                BRAND_STR,
                new TypeReference<Map<Long, String>>() {
                })
        ));
        ACTIONS = Collections.unmodifiableMap(Objects.requireNonNull(JsonUtil.toCustomMap(
                ACTION_STR,
                new TypeReference<Map<Long, String>>() {
                })
        ));
        BRAND_FACTORS = Collections.unmodifiableMap(Objects.requireNonNull(JsonUtil.toCustomMap(
                BRAND_FACTOR_STR,
                new TypeReference<Map<Long, Integer>>() {
                })
        ));
        ACTION_FACTORS = Collections.unmodifiableMap(Objects.requireNonNull(JsonUtil.toCustomMap(
                ACTION_FACTOR_STR,
                new TypeReference<Map<Long, Integer>>() {
                })
        ));
    }

    private ChargeConstants() {
    }
}
